package com.example.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.io.*;

@SpringBootApplication
public class DemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);

        try {
            FileInputStream in=new FileInputStream("F:\\Study\\J2EE\\Project\\IO\\text.txt");
            BufferedReader br = new BufferedReader(new InputStreamReader(in));
            FileOutputStream out=new FileOutputStream("F:\\Study\\J2EE\\Project\\IO\\outtext.txt");
            BufferedWriter brw=new BufferedWriter(new OutputStreamWriter(out));

            String str;

            while((str= br.readLine())!=null){
                System.out.println(str);
                brw.write(str+"\n");
                brw.flush();
            }

        } catch ( Exception e) {
            e.printStackTrace();
        }

    }
}
